Technical Field
This disclosure relates generally to accessing data on a physical recording medium, and more specifically to storing translations in memory that are usable to access data on the physical recording medium.
Description of the Related Art
Modern computer systems may implement a memory-mapping scheme (referred to as a “virtual memory”) in which a larger address space (referred to as a “virtual address space”) is presented than what is actually available in main memory (e.g., random access memory (RAM)). In such a scheme, virtual addresses may map to either physical addresses within the main memory or addresses within persistent storage such as hard disk storage, non-volatile storage media, optical drive storage, etc. To process a request to access a particular memory location, a memory management unit (MMU) may receive a virtual memory address for the memory location and translate the virtual address to a corresponding physical address. The MMU may then reference the physical address to retrieve the desired data.
A virtual address space may be divided into blocks, which in some cases may be referred to as “pages.” These blocks may reside in memory or a particular portion of the persistent storage (referred to as a “swap” file or “swap” partition in Linux or a “page file” in WINDOWS). The locations of pages may be managed by an operating system or a component of an operating system such as a virtual memory manager, that also maintains a mapping of virtual addresses to physical addresses in memory. This mapping may be referred to as a “page table” in some implementations. When a page is not present in memory, in one implementation, the page table does not include virtual address translations for that page (or the translations are no longer valid). If an MMU receives a request for data at a virtual address for that page, the MMU may signal a page fault exception in response to the page table not including a translation for the virtual address. The processor unit may invoke the operating system in response to the exception to cause the operating system to service the page fault (i.e., load the page from persistent storage to memory). The operating system may then update the page table to reflect the insertion of the page into memory. In some instances, moving a page into memory may necessitate removing (i.e., evicting) another page from memory to make space (this operation may be referred to as a “page out” or “page swap” operation.) This evicted page may be stored in persistent storage until it is requested again.